package cc.comac.mom.controller;

import java.util.List;

import cc.comac.mom.bean.EquipPersonnelQualificationManagementOtherInterferBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipPersonnelQualificationManagementService;
import cc.comac.mom.bean.EquipPersonnelQualificationManagement;
import cc.comac.mom.bean.EquipPersonnelQualificationManagementBean;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/EquipPersonnelQualificationManagement")
public class EquipPersonnelQualificationManagementController {

	@Autowired
	private EquipPersonnelQualificationManagementService equipPersonnelQualificationManagementService;

	@ApiOperation(value = "新增人员资历数据")
	@RequestMapping(value = "/insertEquipPersonnelQualificationManagement",method = RequestMethod.POST)
	public ResultBean insertEquipPersonnelQualificationManagement(
			@RequestBody EquipPersonnelQualificationManagement equipPersonnelQualificationManagement) {
		ResultBean insertEquipPersonnelQualificationManagement = equipPersonnelQualificationManagementService
				.insertEquipPersonnelQualificationManagement(equipPersonnelQualificationManagement);
		return insertEquipPersonnelQualificationManagement;
	}

	@ApiOperation(value = "修改人员资历数据")
	@RequestMapping(value = "/updateEquipPersonnelQualificationManagement",method = RequestMethod.POST)
	public ResultBean updateEquipPersonnelQualificationManagement(
			@RequestBody EquipPersonnelQualificationManagement equipPersonnelQualificationManagement) {
		ResultBean updateEquipPersonnelQualificationManagement = equipPersonnelQualificationManagementService
				.updateEquipPersonnelQualificationManagement(equipPersonnelQualificationManagement);
		return updateEquipPersonnelQualificationManagement;
	}

	@ApiOperation(value = "删除人员资历数据")
	@RequestMapping(value = "/batchDelete",method = RequestMethod.POST)
	public ResultBean batchDelete(@RequestBody List<EquipPersonnelQualificationManagement> list) {
		ResultBean batchDelete = equipPersonnelQualificationManagementService.batchDelete(list);
		return batchDelete;
	}

	@ApiOperation(value = "查询人员资历数据")
	@RequestMapping(value = "/selectbySomeFields",method = RequestMethod.POST)
	public ResultBean selectbySomeFields(
			@RequestBody EquipPersonnelQualificationManagementBean equipPersonnelQualificationManagementBean) {
		ResultBean resultBean = equipPersonnelQualificationManagementService
				.selectbySomeFields(equipPersonnelQualificationManagementBean);
		return resultBean;
	}

	/**
	 * 接受其他平台的人员资质数据
	 */
	@ApiOperation(value = "人员资质信息同步")
	@RequestMapping(value = "/batchsave",method = RequestMethod.POST)
	public ResultBean batchsave(
			@RequestBody List<EquipPersonnelQualificationManagementOtherInterferBean> personnel) {
		ResultBean resultBean = equipPersonnelQualificationManagementService
				.batchsave(personnel);
		return resultBean;
	}

}
